// 导出excel文件
`
exportExcelFile(){
  console.log(this.currentTemplateNode);

  if (this.multipleSelection.length<1){
    this.$baseMessage('选择指标后再导出数据!', 'error')
    return false
  }
  let filename = this.currentTemplateNode.name
  console.log(filename);
  extraDetailData(this.multipleSelection, filename).then(res => {
    console.log(res);
    //1.先创建一个a标签
    let a = document.createElement("a");
    //2.给a标签的href赋上下载地址
    a.href = res.data.file_url;
    //3.让a标签不显示在视图中
    a.style.display = "none";
    //4.将a标签append到文档中
    document.body.appendChild(a);
    //5.a标签自点击
    a.click();
    //6.点击下载后，销毁这个节点
    document.body.removeChild(a);
  })
},

// 下载文件重命名
export const GetBlob = (url) => {
  return new Promise((resolve) => {
    const xhr = new XMLHttpRequest()
    xhr.open('GET', url, true)
    xhr.responseType = 'blob'
    xhr.onload = () => {
      if (xhr.status === 200) {
        resolve(xhr.response)
      }
    }
    xhr.send()
  })
}

GetBlob(url).then((blob) => {
  let a = document.createElement('a')
  a.href = window.URL.createObjectURL(blob)
  a.target = '_blank'
  a.download = '重命名的文件名.后缀'
  document.body.appendChild(a)
  a.click()
  document.body.removeChild(a)
})
`
